package com.one.square.core.constant;

/**
 * @author cwm
 * @Description 鉴权常量类
 * @date 2021/10/21 下午4:11
 * @Version 1.0
 */
public interface SecurityConstants {
    /**
     * 认证请求头key
     */
    String AUTHORIZATION_KEY = "Authorization";

    /**
     * JWT令牌前缀
     */
    String JWT_PREFIX = "Bearer ";


    /**
     * Basic认证前缀
     */
    String BASIC_PREFIX = "Basic ";

    /**
     * JWT载体key
     */
    String JWT_PAYLOAD_KEY = "payload";

    /**
     * JWT ID 唯一标识
     */
    String JWT_JTI = "jti";

    /**
     * JWT ID 唯一标识
     */
    String JWT_EXP = "exp";

    /**
     * 黑名单token前缀
     */
    String TOKEN_BLACKLIST_PREFIX = "auth:token:blacklist:";

    String USER_ID_KEY = "userId";

    String USER_NAME_KEY = "username";

    /**
     * 不需要权限
     */
    String PERMIT_ALL = "permitAll()";
    /**
     * 需要授权
     */
    String IS_AUTHENTICATED = "isAuthenticated()";

    String CLIENT_ID_KEY = "client_id";

    String CLIENT_SECREY="client_secret";

    /**
     * JWT存储权限前缀
     */
    String AUTHORITY_PREFIX = "ROLE_";

    /**
     * JWT存储权限属性
     */
    String JWT_AUTHORITIES_KEY = "authorities";

    String GRANT_TYPE_KEY = "grant_type";

    String REFRESH_TOKEN = "refresh_token";


    /**
     * 认证方式
     */
    String AUTHENTICATION_METHOD = "authenticationMethod";

    /**
     * 验证码key前缀
     */
    String VALIDATE_CODE_PREFIX = "VALIDATE_CODE:";

    /**
     * 短信验证码key前缀
     */
    String SMS_CODE_PREFIX = "SMS_CODE:";

    /**
     * 接口文档 Knife4j 测试客户端ID
     */
    String TEST_CLIENT_ID = "test";

    /**
     * 系统管理 web 客户端ID
     */
    String ADMIN_CLIENT_ID = "one-square-web";

    /**
     * 移动端（H5、Android、IOS）客户端ID
     */
    String APP_CLIENT_ID = "one-square-app";

    /**
     * 小程序端（微信小程序、....） 客户端ID
     */
    String WEAPP_CLIENT_ID = "one-square-webapp";

    String  AUTH_TO_ACCESS="auth_to_access:";

    String CLIENT_ID_TO_ACCESS ="client_id_to_access:";

}
